{extend name='base'/}
{block name='content'}
    <ol class="breadcrumb" style="background-color: #f9f9f9;padding:8px 0;margin-bottom:10px;">
        <li>
            <a href=""><i class="fa fa-cogs"></i>
                文章管理</a>
        </li>
        <li class="active">
            <a href="">回收站</a>
        </li>
    </ol>
    <ul class="nav nav-tabs" role="tablist">
        <li class="active"><a href="#tab1">回收站</a></li>
    </ul>
    <form action="" method="post">
        <div class="panel panel-default">
            <div class="panel-body">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th width="5%">编号</th>
                        <th>文章名称</th>
                        <th>文章作者</th>
                        <th width="5%">排序</th>
                        <th>所属分类</th>
                        <th>添加时间</th>
                        <th width="200">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {eq name="$total" value="0"}
                        <tr>
                            <td width="5%"></td>
                            <td></td>
                            <td></td>
                            <td style="color: #8da4bb; position: relative; top: 15px; left: -30px;" >回 收 站 已 经 清 空</td>
                            <td></td>
                            <td></td>
                            <td width="200"></td>
                        </tr>
                    {else /}
                        {foreach name='arc' item='vo'}
                                <tr>
                                    <td>{$vo['arc_id']}</td>
                                    <td>{$vo['arc_title']}</td>
                                    <td>{$vo['arc_author']}</td>
                                    <td>
                                        <input type="text" class="form-control"
                                               onblur="changeSort(this,{$vo['arc_id']})">
                                    </td>
                                    <td>{$vo.category.cate_name}</td>
                                    <td>{:date('Y-m-d',$vo['sendtime'])}</td>
                                    <td>
                                        <div class="btn-group">
                                            <button data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">操作 <span
                                                    class="caret"></span></button>
                                            <ul class="dropdown-menu dropdown-menu-right">
                                                <li><a href="{:url('outToRecycle',['arc_id'=>$vo['arc_id']])}">恢复数据</a></li>
                                                <li class="divider"></li>
                                                <li><a href="javascript:;" onclick="del({$vo['arc_id']})">删除</a></li>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                        {/foreach}
                    {/eq}
                    </tbody>
                </table>
            </div>
        </div>
    </form>
    <div class="pagination pagination-sm pull-right">
       {$arc->render()}
    </div>
    <!-- 标签删除确认 -->
    <div class="modal fade" id="delcfmModel" data-toggle="modal">
        <div class="modal-dialog">
            <div class="modal-content message_align">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">×</span></button>
                    <h4 class="modal-title">提示信息</h4>
                </div>
                <div class="modal-body">
                    <p>您确认要删除吗？</p>
                </div>
                <div class="modal-footer">
                    <a class="btn btn-default" data-dismiss="modal">取消</a>
                    <form action="{:url('del')}" method="post" style="display: inline-block">
                        <input id="del_arcId" type="hidden" name="arc_id" value="">
                        <button class="btn btn-primary" type="submit">确定</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!-- 标签删除确认end -->
    <script>
        //删除
        function del(arc_id) {
            $('#delcfmModel').modal('show');
            $('#del_arcId').val(arc_id);
        }
    </script>
{/block}